import {BaseController} from '../../base';
import {
  ALL,
  Get,
  Inject,
  Provide,
  Query,
  Validate,
  Controller,
} from '@midwayjs/decorator';

@Provide()
@Controller('/api2/user')
export class UserController extends BaseController {

  @Get("/getRoute")
  async getRoute() {
    return {
      code: 200, data: [
        {
          id: 2,
          parentId: 0,
          name: 'Project',
          path: '/Project',
          component: 'Layout',
          redirect: '/Project/ProjectList',
          meta: {title: '项目管理', icon: 'el-icon-phone'}
        },

        //直接 ddl2hjson
        {
          id: 51,
          parentId: 0,
          name: 'system',
          component: 'Layout',
          path:'/system',
          redirect: '/system/ddl2json',
          meta: {title: '代码生成', icon: 'el-icon-goods'}
        },
        {
          id: 52,
          parentId: 51,
          name: 'system-ddl2json',
          component: 'ddl2json',
          path: '/system/ddl2json',
          meta: {title: '代码生成-ddl转界面', icon: 'el-icon-goods'}
        },
        {
          id: 53,
          parentId: 51,
          name: 'system-ddl2json2',
          component: 'ddl2json',
          path: '/system/ddl2json2',
          meta: {title: '代码生成-ddl转界面2', icon: 'el-icon-goods'}
        },
      ]
    }
  }
}
